#include <stdio.h>

int main(){
    int n;
    while (scanf("%d", &n) == 1 && n != 0)
    {
        int count;
        for (count = 0; n != 1; count++)
            n = (n % 2 ? n * 3 + 1 : n ) / 2;
        printf("%d\n", count);
    }
    return 0;
}

